<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>layui</title>
    <div th:include="common :: css"></div>
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <form class="layui-form" th:action="@{/user/consumer/doPost}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label required">邮箱</label>
            <div class="layui-input-block">
                <input type="email" name="email" lay-verify="required|email" placeholder="请输入你的邮箱" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="send">找到密码</button>
            </div>
        </div>
    </form>
</div>
<div th:include="common :: js"></div>
<script>
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(send)', function(){
            layer.alert('发送成功！',
                function(){var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index);
            });
        });
        //邮箱格式校验
        form.verify({
            email: [/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/, "邮箱格式不正确"],
        });
        return false;
    });


</script>
</body>
</html>

